/*参照 vue-router 的实现，定义一个路由隐射表，在路由隐射表里面完成相关的操作*/

import News from '../pages/News';
import Detail from '../pages/Detail';


import Register from '../pages/Register';
import Login from '../pages/Login';

import Collect from '../pages/Collect';

import NotFound from '../pages/NotFound';


const routes = [
    // needAuth 该页面是否需要登录后才可以显示
    {path: '/', name: 'news', component: News, needAuth: false},

    {path: '/news', name: 'news', component: News, needAuth: false},
    {path: '/detail', name: 'detail', component: Detail, needAuth: false},

    {path: '/register', name: 'register', component: Register, needAuth: false},
    {path: '/login', name: 'login', component: Login, needAuth: false},


    {path: '/404', name: 'notFound', component: NotFound, needAuth: false},

    // 我的收藏页面的 needAuth 是为 true 代表是需要登录后才可以查看的
    {path: '/collect', name: 'collect', component: Collect, needAuth: true},

];


export default routes;
